home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / tip / ndaysmo.tip < prev    next >
Text File  |  1993-09-15  |  1KB  |  55 lines

  1. % This macro source file is from the four volume series
  2. % "TeX in Practice" by Stephan von Bechtolsheim, published
  3. % 1993 by Springer-Verlag, New York.
  4. % Copyright 1993 Stephan von Bechtolsheim.
  5. % No warranty or liability is assumed.
  6. % This macro may be copied freely if no fees other than
  7. % media cost or shipping charges are charged and as long
  8. % as this copyright and the following source code itself
  9. % is not changed. Please see the series for further information.
  10. %
  11. % Version: 1.0
  12. % Date: May 1, 1993
  13. %
  14. %
  15. % This source code is documented in 26.7, p. III-366.
  16. % Original source in file "macros6.TEX", starting line 401.
  17. \wlog{L: "ndaysmo.tip" ["macros6.TEX," l. 401, p. III-366]}%
  18. % This file DOES belong to format "texip."
  19. \InputD{legyear.tip}
  20. \InputD{legmonth.tip}
  21. \InputD{isleapyr.tip}
  22. \def\NumberOfDaysInMonth #1#2#3{%
  23.     \CheckLegalYear{#1}%
  24.     \CheckLegalMonth{#2}%
  25.     \ifcase #2\relax
  26.     \or
  27.         #3 = 31
  28.     \or
  29.         #3 = 28
  30.         \if\LeapYearConditional{#1}%
  31.             #3 = 29
  32.         \fi
  33.     \or
  34.         #3 = 31
  35.     \or
  36.         #3 = 30
  37.     \or
  38.         #3 = 31
  39.     \or
  40.         #3 = 30
  41.     \or
  42.         #3 = 31
  43.     \or
  44.         #3 = 31
  45.     \or
  46.         #3 = 30
  47.     \or
  48.         #3 = 31
  49.     \or
  50.         #3 = 30
  51.     \or
  52.         #3 = 31
  53.     \fi
  54. }
  55.